/**
 * 单轴多元素的mixins,动作,相机,3d背景
 * */
import { convertSeconds } from '@veditor/components/timeLine/js/common';
import LineItem from '@veditor/components/timeLine/components/lineItem.vue';
import { debounce } from 'lodash';

export default {
  components: {
    LineItem,
  },
  props: {
    timelineItem: {
      required: true,
      type: Object,
    },
  },
  computed: {},
  data() {
    return {
      sliderArr: [],
    };
  },
  mounted() {
    this.init();
    this.init = debounce(this.init, Number('100'));
    this.timelineItem.onVideoDuration = this.init; // 注册一个坑位函数
  },
  methods: {
    init() {
      this.sliderArr.splice(0, this.sliderArr.length);
      this.sliderArr.push(...this.timelineItem.sliderArr); // 重新更新一下值
    },
    convertTime(time) {
      return convertSeconds(time);
    },
  },
};
